package com.pattern.structure.adapter;

/**
 * @author yangguanzan
 * @date 4/10/22
 * @description
 */
public class ClassAdapter extends Adaptee implements AdapterTarget {

    /**
     * 要以实际的适配目标进行适配，这里简单演示返回值类型进行转换适配
     * @return 字符串转化为整型的值
     */
    @Override
    public int request() {
        System.out.println("类适配器：");
        String result = this.specificRequest();
        if(null==result||result.isEmpty()){
            return 0;
        }
        return Integer.valueOf(result);
    }
}
